<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenShoe: debug.h File Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenShoe
   &#160;<span id="projectnumber">0.1</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#define-members">Defines</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">debug.h File Reference</div>  </div>
</div>
<div class="contents">

<p>Macros and functions dedicated to debug purposes.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;stringz.h&quot;</code><br/>
</div>
<p><a href="debug_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="debug_8h.html#ab92d932ad29de0d43f5e4a8e15f062fd">Uc3_trace_init</a>(debug_addr)&#160;&#160;&#160;*(U32*)(debug_addr)=debug_addr+4</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">These macros are used to add traces memory.  <a href="#ab92d932ad29de0d43f5e4a8e15f062fd"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="debug_8h.html#a91278a91a4af5988028c3cb3fae0664c">Uc3_trace</a>(debug_addr, x)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="debug_8h.html#a12474d91b3b05bbf9677cb258f4daf53">Insert_label</a>(name)&#160;&#160;&#160;__asm__ __volatile__ (STRINGZ(name)&quot;:&quot;);</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">This macro is used to insert labels into assembly output.  <a href="#a12474d91b3b05bbf9677cb258f4daf53"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">U32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="debug_8h.html#af786e504aac20ce8c93920ee2ac564ef">get_heap_free_size</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of free bytes in the HEAP.  <a href="#af786e504aac20ce8c93920ee2ac564ef"></a><br/></td></tr>
<tr><td colspan="2"><div class="groupHeader">Traces function using a round buffer</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="debug_8h.html#ad5062f1eb8420dbb61011ae649b9f509">uc3_round_trace_init</a> (void *buf, U32 size)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the trace using a round buffer.  <a href="#ad5062f1eb8420dbb61011ae649b9f509"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="debug_8h.html#a6813952940e48f9a674a12c7077497bc">uc3_round_trace</a> (U32 val)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Trace a data in the round buffer.  <a href="#a6813952940e48f9a674a12c7077497bc"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Macros and functions dedicated to debug purposes. </p>
<ul>
<li>Compiler: IAR EWAVR32 and GNU GCC for AVR32</li>
<li>Supported devices: All AVR32 devices with a USART module can be used.</li>
</ul>
<dl class="author"><dt><b>Author:</b></dt><dd>Atmel Corporation: <a href="http://www.atmel.com">http://www.atmel.com</a> <br/>
 Support and FAQ: <a href="http://support.atmel.no/">http://support.atmel.no/</a> </dd></dl>
</div><hr/><h2>Define Documentation</h2>
<a class="anchor" id="a12474d91b3b05bbf9677cb258f4daf53"></a><!-- doxytag: member="debug.h::Insert_label" ref="a12474d91b3b05bbf9677cb258f4daf53" args="(name)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define Insert_label</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">name</td><td>)</td>
          <td>&#160;&#160;&#160;__asm__ __volatile__ (STRINGZ(name)&quot;:&quot;);</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>This macro is used to insert labels into assembly output. </p>

</div>
</div>
<a class="anchor" id="a91278a91a4af5988028c3cb3fae0664c"></a><!-- doxytag: member="debug.h::Uc3_trace" ref="a91278a91a4af5988028c3cb3fae0664c" args="(debug_addr, x)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define Uc3_trace</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">debug_addr, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">x&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">*(U32*)(*(U32*)(debug_addr)  ) = (U32)(x)   ;\
      *(U32*)(*(U32*)(debug_addr)+4) = 0xdeadbeef ;\
      *(U32*)(debug_addr  ) = *(U32*)(debug_addr)+4
</pre></div>
</div>
</div>
<a class="anchor" id="ab92d932ad29de0d43f5e4a8e15f062fd"></a><!-- doxytag: member="debug.h::Uc3_trace_init" ref="ab92d932ad29de0d43f5e4a8e15f062fd" args="(debug_addr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define Uc3_trace_init</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">debug_addr</td><td>)</td>
          <td>&#160;&#160;&#160;*(U32*)(debug_addr)=debug_addr+4</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>These macros are used to add traces memory. </p>
<p>First, initialise the trace with <a class="el" href="debug_8h.html#ab92d932ad29de0d43f5e4a8e15f062fd" title="These macros are used to add traces memory.">Uc3_trace_init(pointer)</a>, giving the start address of the memory location where will be stored the trace. Use <a class="el" href="debug_8h.html#a91278a91a4af5988028c3cb3fae0664c">Uc3_trace(something)</a> to store "something" into the memory. The end of the trace is signaled by the "0xdeadbeef" pattern. </p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="af786e504aac20ce8c93920ee2ac564ef"></a><!-- doxytag: member="debug.h::get_heap_free_size" ref="af786e504aac20ce8c93920ee2ac564ef" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">U32 get_heap_free_size </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the number of free bytes in the HEAP. </p>
<p>This funtion tries to allocate the maximum number of bytes by dichotomical method.</p>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">number</td><td>of free bytes. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a6813952940e48f9a674a12c7077497bc"></a><!-- doxytag: member="debug.h::uc3_round_trace" ref="a6813952940e48f9a674a12c7077497bc" args="(U32 val)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void uc3_round_trace </td>
          <td>(</td>
          <td class="paramtype">U32&#160;</td>
          <td class="paramname"><em>val</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Trace a data in the round buffer. </p>
<p>The end of the trace is signaled by the "0xdeadbeef" pattern. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">val</td><td>Data to trace; </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ad5062f1eb8420dbb61011ae649b9f509"></a><!-- doxytag: member="debug.h::uc3_round_trace_init" ref="ad5062f1eb8420dbb61011ae649b9f509" args="(void *buf, U32 size)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void uc3_round_trace_init </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">U32&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initialize the trace using a round buffer. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">buf</td><td>Base address of the buffer used for the trace. </td></tr>
    <tr><td class="paramname">size</td><td>Size of the round buffer. Must be a power of 2. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Tue Nov 29 2011 17:59:31 for OpenShoe by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
